home *** CD-ROM | disk | FTP | other *** search
- Path: cs.tu-berlin.de!news
- From: Roman Lechtchinsky <wolfro@cs.tu-berlin.de>
- Newsgroups: comp.lang.c++
- Subject: Re: borland c 4.5
- Date: 2 Mar 1996 18:26:23 GMT
- Organization: Technical University of Berlin, Germany
- Message-ID: <4ha3sf$iou@news.cs.tu-berlin.de>
- NNTP-Posting-Host: 130.149.17.226
- Mime-Version: 1.0
- Content-Type: text/plain; charset=iso-8859-1
- Content-Transfer-Encoding: 8bit
-
- mleusch@rzdspc1.informatik.uni-hamburg.de (Michael Leuschner) writes:
- >
- > We have a problem concerning Borland C++ 4.5 and hope somebody will be able to
- > help us...
- >
- > We developed a program in C++ with the IDE enviroment and the App Expert and
- > have no problem with that. Now we want to add some C source code but were
- > not successful. It seems that the c++ compiler is able to compile our
- > ANSI c sources but later the linker can't manage to link the mix of
- > c++ and c together...
- >
- > Does anyone have a clue?
- > Is the a known problem (and how can you solve it) ?
-
- I assume that the files with your C source have the .c extension and that
- you use include files to make you function prototypes availble in C++
- modules. The linking information the compiler generates for C++ functions
- is different from that for C functions. You have two possibilities:
-
- a) Rename all of your .C-files to .CPP. The function names will be treated
- C++-like then.
- b) Declare all functions that are implemented in your .C files as follows:
-
- extern "C" {
-
- // function declarations
-
- }
-
- This will tell the compiler that these functions are exported from a C
- module and they will be linked appropriately.
-
- Bye
-
- Roman
-